package com.acoreful.bootsample.event.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.acoreful.bootsample.event.core.publish.EventPublish;

@RestController
@RequestMapping("post")
public class PostController {
	private Logger logger= LoggerFactory.getLogger(getClass());
	@Autowired
	EventPublish eventPublish;

	@GetMapping("new")
	public String test() {
		logger.info("create new post");
		eventPublish.publish("hello wan");
		logger.info("create new post end");
		return "success";
	}
}
